<template>
  <div id="main" style="width: 600px;height:400px;" />
</template>

<script>
import * as echarts from 'echarts/core'
import { TitleComponent, LegendComponent } from 'echarts/components'
import { RadarChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
export default {
  mounted() {
    this.initRadar()
  },
  methods: {
    initRadar() {
      echarts.use([TitleComponent, LegendComponent, RadarChart, CanvasRenderer])
      var chartDom = document.getElementById('main')
      var myChart = echarts.init(chartDom)
      var option

      option = {
        title: {
          text: 'Basic Radar Chart'
        },
        legend: {
          data: ['平均水平', '个人价值']
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: '工作效率', max: 100 },
            { name: '考勤', max: 100 },
            { name: '积极性', max: 100 },
            { name: '帮助同事', max: 100 },
            { name: '自主学习', max: 100 },
            { name: '正确率', max: 100 }
          ]
        },
        series: [{
          name: '平均 vs 个人',
          type: 'radar',
          // areaStyle: {normal: {}},
          data: [
            {
              value: [80, 80, 80, 80, 80, 80],
              name: '平均水平'
            },
            {
              value: [90, 75, 95, 90, 95, 90],
              name: '个人价值'
            }
          ]
        }]
      }

      option && myChart.setOption(option)
    }
  }
}
</script>

<style>

</style>
